package com.gmako.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gmako.dao.BaseDAO;
import com.gmako.entity.Homeimg;
import com.gmako.service.HomeImgService;
@Service
public class HomeImgServiceImpl implements HomeImgService{
	@Autowired
	private BaseDAO baseDAO;
	/**
	 * 添加首页百叶图片
	 * @author qifu
	 * @param homeimg
	 * @return
	 */
	public void addImg(Homeimg homeimg) {
		
		baseDAO.save(homeimg);
	}
	/**
	 * 删除首页百叶图片
	 * @author qifu
	 * @return
	 */
	public void delAll() {
		baseDAO.callProcedure("delete from homeimg");
		
	}
	/**
	 * 修改首页百叶图片
	 * @author qifu
	 * @return
	 */
	public void update(Object obj) {
		baseDAO.update(obj);
	}
	
	/**
	 * 查询首页百叶图片
	 * @author qifu
	 * @return
	 */
	public List<Homeimg> findAll() {
		return (List<Homeimg>) baseDAO.listAll("Homeimg");
	}
	/**
	 * 条件查询首页百叶图片
	 * @author qifu
	 * @return
	 */
	public List<Homeimg> findByProperty(Class clazz, String propertyName,
			Object value) {
		return (List<Homeimg>) baseDAO.findByProperty(clazz.getName(), propertyName, value);
	}

}
